class IndirizzoAggiuntivo < ActiveRecord::Base
  acts_as_paranoid unless SHOW_DELETED
  belongs_to :indirizzo_aggiuntivo_ref, :polymorphic => true
  belongs_to :tipo_indirizzo
  validates_presence_of :tipo_indirizzo, :indirizzo, :localita

  PROVINCE_ITALIANE = ['TO','VC','NO','CN','AT','AL','BI','VB','AO','VA','CO','SO','MI','BG','BS','PV','CR','MN','LC','LO','MB','BZ','TN','VR','VI','BL','TV','VE','PD','RO','UD','GO','TS','PN','IM','SV','GE','SP','PC','PR','RE','MO','BO','FE','RA','FC','RN','MS','LU','PT','FI','LI','PI','AR','SI','GR','PO','PG','TR','PU','AN','MC','AP','FM','VT','RI','RM','LT','FR','AQ','TE','PE','CH','CB','IS','CE','BN','NA','AV','SA','FG','BA','TA','BR','LE','BT','PZ','MT','CS','CZ','RC','KR','VV','TP','PA','ME','AG','CL','EN','CT','RG','SR','SS','NU','CA','OR','OT','OG','VS','CI']

  def name
    "#{indirizzo} #{localita}"
  end
end
